<?php use_helper('Javascript');?>
<?php $deudor_domicilio = $form->getObject() ?>
<h1><?php echo $deudor_domicilio->isNew() ? 'Ingresar' : 'Editar' ?> Domicilio a Deudor</h1>

<?php echo form_remote_tag(array(
    'update'   	=> 'acciones_deudor',
    'url'      	=> 'administracion/updatedeudordomicilio?deudor='.$deudor.(!$deudor_domicilio->isNew() ? '&?id='.$deudor_domicilio->getId() : ''),
	'loading'	=> visual_effect('appear','loading'),
	'complete'	=> visual_effect('fade','loading'),
))?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          &nbsp;<?php echo button_to_remote('Cancelar', array(
          				'update'	=> 'modulo',
          				'url'		=> 'administracion/indexdeudor',
          				'loading'	=> visual_effect('appear','loading', array('duration' => 0)),
						'complete'	=> visual_effect('fade','loading', array('duration' => 0)), )); ?>
          <?php if (!$deudor_domicilio->isNew()): ?>
            &nbsp;<?php echo button_to_remote('Borrar Domicilio', array(
    						'update'   => 'modulo',
    						'url'      => 'administracion/deletedeudordomicilio?id='.$deudor_domicilio->getId(),
    						'confirm'  => 'Esta seguro que desea eliminar el domicilio del deudor?',
            				'loading'  => visual_effect('appear','loading'),
							'complete' => visual_effect('fade','loading').
											"alert('Se ha eliminado el domicilio')",
          		)); ?>
          <?php endif; ?>
          <input type="submit" value="Guardar" />
        </td>
        <td colspan="2">
          <?php if(!$deudor_domicilio->isNew()): ?>
          	&nbsp;<?php echo button_to_remote('A&ntilde;adir Tel&eacute;fono', array(
          				'update'	=> 'acciones_deudor',
          				'url'		=> 'administracion/edittelefono?iddeudordomicilio='.$deudor_domicilio->getId(),
          				'loading'	=> visual_effect('appear','loading', array('duration' => 0)),
          				'complete'	=> visual_effect('fade','loading',array('duration' => 0)),
          	)); ?>
          	&nbsp;<?php echo button_to_remote('Editar Tel&eacute;fonos', array(
          				'update'	=> 'list-search-telefono',
          				'url'		=> 'administracion/searchtelefonodomicilioupdate?accion=edittelefono&iddeudordomicilio='.$deudor_domicilio->getId(),
          				'loading'	=> visual_effect('appear','loading',array('duration' => 0)),
          				'complete'	=> visual_effect('appear','list-search-telefono').
										visual_effect('highlight','list-search-telefono',array('duration' => 1.0)).
										visual_effect('fade','loading'),)); ?>
          <?php endif; ?>
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><label for="deudor_domicilio_deudor_id">Nombre de Deudor</label></th>
        <td>
          <?php echo $form['deudor_id']->renderError() ?>
          <?php echo $form['deudor_id'] ?>
          <?php echo $deudor ?>
        </td>
      </tr>
      <tr>
        <th><label for="deudor_domicilio_calle">Calle</label></th>
        <td>
          <?php echo $form['calle']->renderError() ?>
          <?php echo $form['calle'] ?>
        </td>
        <th><label for="deudor_domicilio_numero">N&uacute;mero</label></th>
        <td>
          <?php echo $form['numero']->renderError() ?>
          <?php echo $form['numero'] ?>
        </td>
        
      </tr>
      <tr>
        <th><label for="deudor_domicilio_comuna">Comuna</label></th>
        <td>
          <?php echo $form['comuna']->renderError() ?>
          <?php echo $form['comuna'] ?>
        </td>
        <th><label for="deudor_domicilio_region">Regi&oacute;n</label></th>
        <td>
          <?php echo $form['region']->renderError() ?>
          <?php echo $form['region'] ?>
        </td>
      </tr>
      <tr>
        <th><label for="deudor_domicilio_depto">Departamento</label></th>
        <td>
          <?php echo $form['depto']->renderError() ?>
          <?php echo $form['depto'] ?>
        </td>
        <th><label for="deudor_domicilio_cuidad">Ciudad</label></th>
        <td>
          <?php echo $form['cuidad']->renderError() ?>
          <?php echo $form['cuidad'] ?>
        </td>
      </tr>
      <tr>
        <th><label for="deudor_domicilio_villa">Villa / Poblaci&oacute;n</label></th>
        <td>
          <?php echo $form['villa']->renderError() ?>
          <?php echo $form['villa'] ?>
        </td>
        <th><label for="deudor_domicilio_telefono">Tel&eacute;fono</label></th>
        <td>
          <?php echo $form['telefono']->renderError() ?>
          <?php echo $form['telefono'] ?>

        <?php echo $form['id'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
<div id="list-search-telefono" class="pop-up" style="display:none"></div>